/*******************************************************************************************************
Author: Arun Ramachandran
Version: 1.0
Purpose: To call batchable class whenever new records are inserted in the AF Assigned object. The trigger will
scan all records which have Ready_To_Delete__c flag checked.

Update[Arun [1/9]] - Updated API version to 22.0 from 23.0
*********************************************************************************************************/



trigger OORAFAssignedHistoryDelete on AF_Assigned_History__c (after insert) {

        OORDeleteRecords job = new OORDeleteRecords();
        job.Query = 'Select Id from AF_Assigned_History__c where Ready_to_Delete__c=true'; 
        Database.executeBatch(job, 100);      
}